package com.river.springbootdemo.thinkingjava.objectrefer;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class Pets {
    private static final String[] NAME_ARRAY = {"Rat", "Manx", "Cymric", "Mutt", "Pug", "EgyptianMau", "Hamster", "Mouse"};
    private static final Random random = new Random(47);

    public static List<Pet> arrayList(int num) {
        ArrayList<Pet> pets = new ArrayList<>();
        for (int i = 0; i < num; i++) {
            pets.add(new Pet());
        }
        return pets;
    }

    public static Pet randomPet() {
        return new Pet(NAME_ARRAY[random.nextInt(NAME_ARRAY.length)]);
    }
}
